<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>友情链接管理</title>
		<script type="text/javascript" src="../js/jquery.js"></script>
		<script language='javascript'>
function CheckSubmit()
{
	if(document.form1.url.value=="http://"||document.form1.url.value=="")
	{
   		document.form1.url.focus();
   		alert("网址不能为空！");
   		return false;
	}
	if(document.form1.webname.value=="")
	{
   		document.form1.webname.focus();
   		alert("网站名称不能为空！");
   		return false;
	}
	return true;
}	
</script>
		<link rel="stylesheet" type="text/css" href="../css/style1.css" />
		<link rel="stylesheet" type="text/css" href="../css/base.css" />
		<link rel="stylesheet" type="text/css" href="../css/indexbody.css" />
		<script type="text/javascript" src="../js/frame.js"></script>
		<script type="text/javascript"
			src="../js/My97DatePicker/WdatePicker.js"></script>
		<script src="../js/jquery-1.5.1.min.js" type="text/javascript"></script>
		<script type="text/javascript"
			src="../js/jquery.easydrag.handler.beta2.js"></script>
		<script type="text/javascript">
	window.onload=function(){
		document.getElementById("hide").style.display="block";
			document.getElementById("sc").style.display="none";
			document.getElementById("vip").style.display='none';
			document.getElementById("mb").style.display='none';
			document.getElementById("sys").style.display='none';
	}
	function popupDiv(div_id) { 
			$("body").css("background-color","#E6E6E6");
            var div_obj = $("#" + div_id); 
            //窗口宽度,高度 
            var winWidth = $(window).width(); 
            var winHeight = $(window).height(); 
            //弹出的div的宽度,高度 
            var popHeight = div_obj.height(); 
            var popWidth = div_obj.width(); 
            div_obj.animate({ opacity: "show", left: (winWidth-popWidth) / 2, top: (winHeight-popHeight)/2,width:popWidth,height:popHeight}, 300);   
        }         
        function hideDiv(div_id) { 
            $("#" + div_id).animate({opacity: "hide" }, 300); 
			$("body").css("background-color","#ffffff");
        } 
        $(function() { 
            $(".pop_box").easydrag(); 
            $(".pop_box").setHandler(".pop_box .p_head"); 
         }); 
</script>
	</head>
	<body background='../images/allbg.gif' leftmargin='8' topmargin='8'>
		<div id="container">
			<jsp:include page="../header.jsp"></jsp:include>
			<div style="float: left; width: 195px; height: 550px">
				<jsp:include page="../leftnav.jsp"></jsp:include>
			</div>
			<div
				style="float: left; overflow-y: scroll; overflow-x: hidden; width: 785px; height: 550px;">

				<table width="98%" border="0" align="center" cellpadding="3"
					cellspacing="1" bgcolor="#D6D6D6">
					<tr>
						<td height="28" background="../images/tbg.gif"
							style="padding-left: 10px;">
							<b><a href="<%=path%>/manager/core/findLinksAll.action"><u>友情链接管理</u>
							</a>
							</b>&gt;&gt;增加链接
						</td>
					</tr>
					<tr>
						<td height="200" bgcolor="#FFFFFF" valign="top">
							<form action="<%=path%>/manager/core/addLinksAction.action"
								method="post" name="form1" onSubmit="return CheckSubmit();">
								<table width="80%" border="0" cellspacing="1" cellpadding="3">
									<tr>
										<td height="25">
											网站Logo：
										</td>
										<td>
										
										<s:if test="uploadLogo!=null">
										<input type="hidden" name="links.hostLogo" value="<s:property value='uploadLogo'/>"/>
											<img src="<s:property value="uploadLogo"/>" alt="网站logo" title="网站logo"
												id="logoImage" width="150" height="50" border="0" />
										</s:if>
										<s:else>
										<input type="hidden" name="links.hostLogo" value="../images/top_logo.gif"/>
											<img src="../images/top_logo.gif" alt="网站logo" title="网站logo"
												id="logoImage" width="150" height="50" border="0" />
										</s:else>
											<input type="button" value="请选择LOGO" class="log" onclick="popupDiv('pop_div');" />
										</td>
									</tr>
									<tr>
										<td width="19%" height="25">
											网址：
										</td>
										<td width="81%">
										<!-- <s:textfield name="links.hostAddress" value="http://" id="url" cssClass="pubinputs" theme="simple"></s:textfield> -->
											<input name="links.hostAddress" type="text" id="url"
												value="http://" size="30" class='pubinputs' />
										</td>
									</tr>
									<tr>
										<td height="25">
											网站名称：
										</td>
										<td>
										<!-- <s:textfield name="links.hostName" value="" cssClass="pubinputs" id="webname" theme="simple"></s:textfield> -->
											<input name="links.hostName" type="text" id="webname"
												size="30" class='pubinputs' /> 
										</td>
									</tr>
									<tr>
										<td width="19%" height="25">
											排列位置：
										</td>
										<td width="81%">
										<!-- <s:textfield name="links.orders" value=""cssClass="pubinputs" id="sortrank" theme="simple" cssStyle="width:50px"></s:textfield> -->
											<input name="links.orders" type="text" id="sortrank" value=""
												size="10" class='pubinputs' style='width: 60px' />
											(由小到大排列)
										</td>
									</tr>
								
									<tr>
										<td height="25">
											网站简况：
										</td>
										<td>
										<!-- <s:textarea name="links.description" cols="38" rows="4" theme="simple" id="msg"></s:textarea> -->
											<textarea name="links.description" cols="38" rows="4"
												id="msg"></textarea>
										</td>
									</tr>
									<tr>
										<td height="25">
											站长Email：
										</td>
										<td>
									<!-- 	<s:textfield name="links.hostEmail" value="" cssClass="pubinputs" id="webname" theme="simple"></s:textfield> -->
											<input name="links.hostEmail" type="text" id="email"
												size="30" class='pubinputs' />
										</td>
									</tr>
									<tr>
										<td height="25">
											创建时间：
										</td>
										<td>
										<!-- <s:textfield name="links.createTime" value="" cssClass="pubinputs" theme="simple" onclick="WdatePicker({isShowWeek:true})" readonly="readonly"></s:textfield> -->
										<input name="links.createTime" type="text" value=""
												class='pubinputs' onclick="WdatePicker({isShowWeek:true})"
												readonly="readonly" style="width: 180px" />
										</td>
									</tr>
									<tr>
										<td height="51">
											&nbsp;
										</td>
										<td>
											<input type="submit" name="Submit" value=" 提 交 "
												class="coolbg np" />
											<input type="reset" name="Submit" value=" 重 置 "
												class="coolbg np" />
										</td>
									</tr>
								</table>
							</form>
						</td>
					</tr>
				</table>
				<div id='pop_div' class="pop_box"> 
        <div class="p_head">
            <div class="p_h_title">请选择Logo >><a class="p_h_x" onclick="hideDiv('pop_div');" title="关闭窗口"><img src="../images/x.jpg" style="margin-top:8px;" /></a></div>
        </div>
        <form action="<%=path %>/manager/core/uploadAction.action" method="post" enctype="multipart/form-data">
        <div style=" height:90px; width:350px; margin-top:80px; margin-left:20px;">
        	<ul style="line-height:40px;">
            	<li style=" color:#999; font-weight:bold;">在你的电脑上选择一张图片</li>
                <li>
                <!-- <input type="file" name="file" id="file" style="height:21px; border:#CCC 1px solid; width:250px;" /> -->
                	<s:file name="file" id="file" cssStyle="height:21px; border:#CCC 1px solid; width:250px;" theme="simple"></s:file>
                </li>
            </ul>
            <div style="font-size:12px; font-weight:bold; color:#999; text-align:center; margin:0 auto; margin-top:20px;" >
            支持JPG. JPEG. PNG等格式的图片，图片大小不超过1MB<br />
            </div>
            <div style=" margin-top:70px; width:200px; margin-left:100px">
            	<input type="submit" value="开始上传" />&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="button" value="取消上传" onclick="hideDiv('pop_div'); "/>
            </div>
        </div>
        </form>
    </div> 
			</div>
		</div>
	</body>
</html>